#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
	
	unsigned int i1, i2;
	const char* a = "TestBufferfromChar";
	const wchar_t *b = L"TestBufferfromWchar_t";
	char* c = new char[100];
	wchar_t *d = new wchar_t[100];
	wcstombs_s(&i1, c, wcslen(b)+1, b, _TRUNCATE);
	mbstowcs_s(&i2, d, strlen(a) + 1, a, _TRUNCATE);
	printf("wchar_t: \nBefore:%ls\nAfter:%s\nBefore:%d\nAfter:%d\n", b, c,wcslen(b)+1,strlen(c)+1);
	printf("char: \nBefore:%s\nAfter:%ls\nBefore:%d\nAfter:%d\n", a, d,strlen(a)+1,wcslen(d)+1);
	delete[] c, d;
	system("pause");
	return 0;
}